feat: add GitHub Copilot support with rewritten inline suggestion architecture#850
Open
feat: add GitHub Copilot support with rewritten inline suggestion architecture#850
Conversation
17d7287 to
e50815a
Compare
… instead of preamble hack
…ng, dead state, poll cancellation
Signed-off-by: Ngô Quốc Đạt <datlechin@gmail.com>
…, integrity check, localization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #754
Adds GitHub Copilot support to TablePro with a complete rewrite of the inline suggestion architecture and a new AI provider registry pattern.
Inline Suggestion Architecture Rewrite
InlineSuggestionManagerinto a clean, protocol-based systemInlineSuggestionSourceprotocol for pluggable suggestion sourcesGhostTextRendererfor CATextLayer ghost text displayAIChatInlineSourcefor existing AI provider path (Claude, OpenAI, etc.)Generic LSP Client
Core/LSP/withLSPTransport(stdio JSON-RPC 2.0),LSPClient(typed methods),LSPTypes,LSPDocumentManagerGitHub Copilot Integration
CopilotService: language server lifecycle, OAuth device flow auth, exponential backoff restartCopilotBinaryManager: download native binary from npm with SHA1 integrity verificationCopilotInlineSource: inline completions viatextDocument/inlineCompletionwith proper ghost text rendering and replacement range handlingCopilotDocumentSync: editor text changes synced to LSP with server-restart awarenessCopilotSchemaContext: database schema preamble (table names, columns, types) prepended to document for schema-aware suggestionsCopilotChatProvider: chat viaconversation/create+conversation/turnLSP protocol with streamingAI Provider Registry
AIProviderDescriptor+AIProviderRegistry+AIProviderRegistrationfor extensible provider registrationAIProviderFactorytries registry first, hardcoded switch as fallbackUnified Settings
InlineSuggestionProviderpicker in Editor settings (Off / GitHub Copilot / AI Provider)Architecture
Files (36 changed)
New (18):
Core/LSP/— LSPTypes, LSPTransport, LSPClient, LSPDocumentManagerCore/AI/InlineSuggestion/— InlineSuggestionSource, GhostTextRenderer, AIChatInlineSource, InlineSuggestionManagerCore/AI/Copilot/— CopilotService, CopilotAuthManager, CopilotBinaryManager, CopilotDocumentSync, CopilotInlineSource, CopilotSchemaContext, CopilotChatProviderCore/AI/Registry/— AIProviderDescriptor, AIProviderRegistry, AIProviderRegistrationModels/AI/CopilotSettings.swift,Views/Settings/CopilotSettingsView.swiftModified (8): AIModels, AIProviderFactory, SQLEditorCoordinator, SQLEditorView, EditorSettings, EditorSettingsView, AISettingsView, AppSettingsManager, AppSettingsStorage, SettingsView, TableProApp
Deleted (1):
Core/AI/InlineSuggestionManager.swift(replaced by decomposed files)Test plan
InlineSuggestionManagerFocusTestspass (12/12)AISettingsTestspass (3/3)